import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { TrainingVideoVO, TrainingVideoForm, TrainingVideoQuery } from '@/api/bclt/trainingVideo/types';

/**
 * 查询手环---跟练列表
 * @param query
 * @returns {*}
 */

export const listTrainingVideo = (query?: TrainingVideoQuery): AxiosPromise<TrainingVideoVO[]> => {
  return request({
    url: '/bclt/trainingVideo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询手环---跟练详细
 * @param id
 */
export const getTrainingVideo = (id: string | number): AxiosPromise<TrainingVideoVO> => {
  return request({
    url: '/bclt/trainingVideo/' + id,
    method: 'get'
  });
};

/**
 * 新增手环---跟练
 * @param data
 */
export const addTrainingVideo = (data: TrainingVideoForm) => {
  return request({
    url: '/bclt/trainingVideo',
    method: 'post',
    data: data
  });
};

/**
 * 修改手环---跟练
 * @param data
 */
export const updateTrainingVideo = (data: TrainingVideoForm) => {
  return request({
    url: '/bclt/trainingVideo',
    method: 'put',
    data: data
  });
};

/**
 * 删除手环---跟练
 * @param id
 */
export const delTrainingVideo = (id: string | number | Array<string | number>) => {
  return request({
    url: '/bclt/trainingVideo/' + id,
    method: 'delete'
  });
};
